<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, minimal-ui" />
        
        <title>Permissions Documentation</title>
        
        <script src="/js/greyspots.js" type="text/javascript"></script>
        <link href="/css/greyspots.css" type="text/css" rel="stylesheet" />
        
        <script src="/js/ace/ace.js" data-ace-base="/js/ace/" type="text/javascript" charset="utf-8"></script>
        <script src="/js/ace/ext-language_tools.js" type="text/javascript"></script>
        <script src="/js/ace/ext-searchbox.js" type="text/javascript"></script>
        
        <script src="doc-library/doc.js" type="text/javascript"></script>
        <link href="doc-library/doc.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <gs-jumbo>
            <h1 class="text-center">Permissions</h1>
        </gs-jumbo>
            
        <gs-container min-width="sml;med;lrg">
            <h3>Description:</h3>
            <p>File permissions are done using PostgreSQL groups. Before you read this page, please read about <a href="http://www.postgresql.org/docs/9.2/static/user-manag.html">PostgreSQL permissions.</a> PostgreSQL <code>ROLE</code>s that you want to be able to login to the website need the group <code>trusted_g</code>.</p>
            
            <hr/>
            <h1>Role <small>(Our name for Document Control)</small></h1>
            
            <h3>Types of folders:</h3>
            <ul>
                <li>All</li>
                <li>Group Folders</li>
                <li>User Folders</li>
            </ul>
            
            <p>Folder permissions are only checked for the first level.</p>
            
            <h3>All Folder:</h3>
            <ul>
                <li>There can be only one <code>all/</code> folder.</li><!-- TODO: Add picture of Kurgan. -->
                <li>Developers can read/write.</li>
                <li>Everybody with a cookie can read.</li>
            </ul>
            
            <h3>Group Folder:</h3>
            <ul>
                <li>Groups should end in _g.</li>
                <li>The folder name must be the group name. Example: To read the file <code>blog_g/index.html</code> you must have the group <code>blog_g</code>.</li>
                <li>Developers can read/write.</li>
                <li>A user with the a group name that ends in _w and a group that end in _g can read and write. Example: To write the file <code>blog_g/index.html</code> you must have the group <code>blog_g</code> and <code>blog_w</code>.</li>
            </ul>
            
            <h3>User Folder:</h3>
            <ul>
                <li>Users can have their own folder.</li>
                <li>The folder name must be the username. Example: To read the file <code>john@example.com/index.html</code> you must be the user <code>john@example.com</code>.</li>
                <li>Developers can read/write.</li>
                <li>Nobody else has access.</li>
            </ul>
            
            <hr/>
            <h1>Dev/Apps, Public/Webroot <small>(Accessed from File Manager)</small></h1>
            
            <h3>Types of Folders:</h3>
            <ul>
                <li>All</li>
                <li>Group Folders</li>
                <li>User Folders</li>
            </ul>
            
            <p>Folder permissions are only checked for the first level.</p>
            
            <h3>All Folder:</h3>
            <ul>
                <li>There can be only one <code>all/</code> folder.</li><!-- TODO: Add picture of Kurgan. -->
                <li>Developers can read/write.</li>
                <li>Everybody with a cookie can read.</li>
            </ul>
            
            <h3>Group Folder:</h3>
            <ul>
                <li>Groups should end in _g.</li>
                <li>The folder name must be the group name. Example: To read the file <code>blog_g/index.html</code> you must have the group <code>blog_g</code>.</li>
                <li>Developers can read/write.</li>
                <li>Users can't read/write.</li>
            </ul>
            
            <h3>User Folder:</h3>
            <ul>
                <li>Users can have their own folder.</li>
                <li>The folder name must be the username. Example: To read the file <code>john@example.com/index.html</code> you must be the user <code>john@example.com</code>.</li>
                <li>Developers can read/write.</li>
                <li>Users can't read/write.</li>
            </ul>
        </gs-container>
    </body>
</html>